import { defineStore } from "pinia";
export const useCountStore = defineStore("count", {
  state: () => ({
    count: 0,
  }),
  actions: {
    increment(amount: number) {
      this.count += amount;
    },
    decrement(amount: number) {
      this.count -= amount;
    },
  },
  //当state里面的数据需要加工再显示的时候
  getters: {
    bigCount(): number {
      return this.count * 100;
    },
  },
});
